package com.wx.whatever.controller;

import com.wx.whatever.entity.User;
import com.wx.whatever.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping(value = "id/{id}")
    @ResponseBody
    public User getUserById(@PathVariable Integer id, HttpServletRequest request) {
        return userService.getById(id);
    }


}
